package us.pigsoft.client;

public class InputHandler {
	static boolean[] keys = new boolean[256];
	static boolean mouseKeys, mousePressed;
	
	static void setKey(int key, boolean state) {
		keys[key] = state;
	}
	
	static boolean getKey(int key) {
		return keys[key];
	}
	
	static int getMousePress(boolean left)
	{
		// 0 = left, 1 = right, -1 = none
		if(mousePressed)
		{
			if(mouseKeys)
				return 0;
			return 1;
		}
		return -1;
	}
	
	static void setMousePress(boolean left)
	{
		mousePressed = true;
		if(left)
			mouseKeys = true;
		else
			mouseKeys = false;
	}
	
	static void setReleased()
	{
		mousePressed = false;
	}
}
